using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_webparts_Plug_ins_User_Default : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string action = Request.QueryString["action"];
            string filter = Request.QueryString["filter"];
            string controlName = string.Empty;

            if ("search".Equals(action, StringComparison.OrdinalIgnoreCase))
            {
                controlName = "UserSearch.ascx";
            }
            else if ("list".Equals(action, StringComparison.OrdinalIgnoreCase))
            {
                controlName = "UserList.ascx";

                //if ("create".Equals(filter, StringComparison.OrdinalIgnoreCase)
                //    || "post".Equals(filter, StringComparison.OrdinalIgnoreCase)
                //    || "active".Equals(filter, StringComparison.OrdinalIgnoreCase)
                //    || "inactive".Equals(filter, StringComparison.OrdinalIgnoreCase)
                //    || "pause".Equals(filter, StringComparison.OrdinalIgnoreCase)
                //    || "mostpost".Equals(filter, StringComparison.OrdinalIgnoreCase)
                //    || "mostmoney".Equals(filter, StringComparison.OrdinalIgnoreCase))
                //{
                //    controlName = "UserList.ascx";
                //}
            }
            else if ("detail".Equals(action, StringComparison.OrdinalIgnoreCase))
            {
                controlName = "UserDetail.ascx";
            }
            else if ("active".Equals(action, StringComparison.OrdinalIgnoreCase))
            {
                controlName = "ActivateUser.ascx";
            }
            else if ("deactive".Equals(action, StringComparison.OrdinalIgnoreCase))
            {
                controlName = "DeactivateUser.ascx";
            }

            if (controlName == string.Empty)
            {
                controlName = "UserSearch.ascx";
            }

            Control ctrl = this.LoadControl(controlName);
            this.contentCont.Controls.Add(ctrl);
        }
        catch (Exception ex)
        {
            HtmlGenericControl ctrl = new HtmlGenericControl("div");
            ctrl.InnerHtml = "<p>" + ex.Message + "</p><p>" + ex.StackTrace + "</p>";
            this.contentCont.Controls.Add(ctrl);
        }

    }
}
